package com.umeng.analytics.pro;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.BitSet;
import java.util.Collections;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class bk implements cg, Serializable, Cloneable {
    static class a extends dp {
        private a() {

        }

        public void a(df arg6, bk arg7) throws cm {
            int v4 = 11;
            arg6.j();
            while (true) {
                da v0 = arg6.l();
                if (v0.b == 0) {
                    break;
                }

                switch (v0.c) {
                    case 1: {
                        if (v0.b == v4) {
                            arg7.a = arg6.z();
                            arg7.a(true);
                            break;
                        }

                        di.a(arg6, v0.b);
                        break;
                    }
                    case 2: {
                        if (v0.b == v4) {
                            arg7.b = arg6.z();
                            arg7.b(true);
                            break;
                        }

                        di.a(arg6, v0.b);
                        break;
                    }
                    case 3: {
                        if (v0.b == v4) {
                            arg7.c = arg6.z();
                            arg7.c(true);
                            break;
                        }

                        di.a(arg6, v0.b);
                        break;
                    }
                    case 4: {
                        if (v0.b == 10) {
                            arg7.d = arg6.x();
                            arg7.d(true);
                            break;
                        }

                        di.a(arg6, v0.b);
                        break;
                    }
                    default: {
                        di.a(arg6, v0.b);
                        break;
                    }
                }

                label_10:
                arg6.m();
            }

            arg6.k();
            if (!arg7.n()) {
                throw new dg("Required field \'ts\' was not found in serialized data! Struct: " + this.toString());
            }

            arg7.o();
        }

        public void a(df arg1, cg arg2) throws cm {
            this.b(arg1, ((bk) arg2));
        }

        public void b(df arg3, bk arg4) throws cm {
            arg4.o();
            arg3.a(bk.q());
            if (arg4.a != null) {
                arg3.a(bk.r());
                arg3.a(arg4.a);
                arg3.c();
            }

            if (arg4.b != null && (arg4.h())) {
                arg3.a(bk.s());
                arg3.a(arg4.b);
                arg3.c();
            }

            if (arg4.c != null) {
                arg3.a(bk.t());
                arg3.a(arg4.c);
                arg3.c();
            }

            arg3.a(bk.u());
            arg3.a(arg4.d);
            arg3.c();
            arg3.d();
            arg3.b();
        }

        public void b(df arg1, cg arg2) throws cm {
            this.a(arg1, ((bk) arg2));
        }
    }

    static class b implements do0 {

        private b() {

        }

        public a a() {
            return new a();
        }

        public dn b() {
            return this.a();
        }
    }

    static class c extends dq {
        private c() {

        }

        public void a(df arg3, bk arg4) throws cm {
            ((dl) arg3).a(arg4.a);
            ((dl) arg3).a(arg4.c);
            ((dl) arg3).a(arg4.d);
            BitSet v0 = new BitSet();
            if (arg4.h()) {
                v0.set(0);
            }

            ((dl) arg3).a(v0, 1);
            if (arg4.h()) {
                ((dl) arg3).a(arg4.b);
            }
        }

        public void a(df arg1, cg arg2) throws cm {
            this.a(arg1, ((bk) arg2));
        }

        public void b(df arg4, bk arg5) throws cm {
            arg5.a = ((dl) arg4).z();
            arg5.a(true);
            arg5.c = ((dl) arg4).z();
            arg5.c(true);
            arg5.d = ((dl) arg4).x();
            arg5.d(true);
            if (((dl) arg4).b(1).get(0)) {
                arg5.b = ((dl) arg4).z();
                arg5.b(true);
            }
        }

        public void b(df arg1, cg arg2) throws cm {
            this.b(arg1, ((bk) arg2));
        }
    }

    static class d implements do0 {

        private d() {

        }

        public c a() {
            return new c();
        }

        public dn b() {
            return this.a();
        }
    }

    public enum bk$e implements cn {
        DOMAIN((short) 1, "domain"),
        OLD_ID((short) 2, "old_id"),
        NEW_ID((short) 3, "new_id"),
        TS((short) 4, "ts");

        private static final Map<String, bk$e> e;
        private final short f;
        private final String g;

        static {
            e = new HashMap();
            Iterator it = EnumSet.allOf(bk$e.class).iterator();
            while (it.hasNext()) {
                bk$e eVar = (bk$e) it.next();
                e.put(eVar.b(), eVar);
            }
        }

        private bk$e(short s, String str) {
            this.f = s;
            this.g = str;
        }

        public static bk$e a(int i) {
            switch (i) {
                case 1:
                    return DOMAIN;
                case 2:
                    return OLD_ID;
                case 3:
                    return NEW_ID;
                case 4:
                    return TS;
                default:
                    return null;
            }
        }

        public static bk$e a(String str) {
            return e.get(str);
        }

        public static bk$e b(int i) {
            bk$e a = a(i);
            if (a != null) {
                return a;
            }
            throw new IllegalArgumentException("Field " + i + " doesn't exist!");
        }

        public final short a() {
            return this.f;
        }

        public final String b() {
            return this.g;
        }
    }


    public String a;
    public String b;
    public String c;
    public long d;
    public static final Map<e, cs> e;
    private static final long f = 9132678615281394583L;
    private static final dk g;
    private static final da h;
    private static final da i;
    private static final da j;
    private static final da k;
    private static final Map<Class<? extends dn>, do0> l;
    private static final int m = 0;
    private byte n;
    private bk$e[] o;

    static {
        g = new dk("IdJournal");
        h = new da("domain", (byte) 11, (short) 1);
        i = new da("old_id", (byte) 11, (short) 2);
        j = new da("new_id", (byte) 11, (short) 3);
        k = new da("ts", (byte) 10, (short) 4);
        HashMap v0 = new HashMap();
        l = ((Map) v0);
        ((Map) v0).put(dp.class, new b());
        l.put(dq.class, new d());
        EnumMap v0_1 = new EnumMap(e.class);
        ((Map) v0_1).put(bk$e.DOMAIN, new cs("domain", (byte) 1, new ct((byte) 11)));
        ((Map) v0_1).put(bk$e.OLD_ID, new cs("old_id", (byte) 2, new ct((byte) 11)));
        ((Map) v0_1).put(bk$e.NEW_ID, new cs("new_id", (byte) 1, new ct((byte) 11)));
        ((Map) v0_1).put(bk$e.TS, new cs("ts", (byte) 1, new ct((byte) 10)));
        e = Collections.unmodifiableMap(v0_1);
        cs.a(bk.class, bk.e);
    }

    public bk() {

        this.n = 0;
        this.o = new bk$e[]{bk$e.OLD_ID};
    }

    public bk(bk arg4) {

        this.n = 0;
        this.o = new bk$e[]{bk$e.OLD_ID};
        this.n = arg4.n;
        if (arg4.e()) {
            this.a = arg4.a;
        }

        if (arg4.h()) {
            this.b = arg4.b;
        }

        if (arg4.k()) {
            this.c = arg4.c;
        }

        this.d = arg4.d;
    }

    public bk(String arg2, String arg3, long arg4) {
        this();
        this.a = arg2;
        this.c = arg3;
        this.d = arg4;
        this.d(true);
    }

    public bk a(String arg1) {
        this.a = arg1;
        return this;
    }

    public bk a(long arg2) {
        this.d = arg2;
        this.d(true);
        return this;
    }

    private void a(ObjectInputStream arg3) throws IOException, ClassNotFoundException {
        try {
            this.n = 0;
            this.a(new cz(new dr(((InputStream) arg3))));
            return;
        } catch (cm v0) {
            throw new IOException(v0.getMessage());
        }
    }

    public void a(df arg3) throws cm {
        bk.l.get(arg3.D()).b().b(arg3, ((cg) this));
    }

    private void a(ObjectOutputStream arg3) throws IOException {
        try {
            this.b(new cz(new dr(((OutputStream) arg3))));
            return;
        } catch (cm v0) {
            throw new IOException(v0.getMessage());
        }
    }

    public bk$e a(int arg2) {
        return bk$e.a(arg2);
    }

    public bk a() {
        return new bk(this);
    }

    public void a(boolean arg2) {
        if (!arg2) {
            this.a = null;
        }
    }

    public bk b(String arg1) {
        this.b = arg1;
        return this;
    }

    public void b(df arg3) throws cm {
        bk.l.get(arg3.D()).b().a(arg3, ((cg) this));
    }

    public cn b(int arg2) {
        return this.a(arg2);
    }

    public void b() {
        this.a = null;
        this.b = null;
        this.c = null;
        this.d(false);
        this.d = 0;
    }

    public void b(boolean arg2) {
        if (!arg2) {
            this.b = null;
        }
    }

    public bk c(String arg1) {
        this.c = arg1;
        return this;
    }

    public String c() {
        return this.a;
    }

    public void c(boolean arg2) {
        if (!arg2) {
            this.c = null;
        }
    }

    public void d(boolean arg3) {
        this.n = cd.a(this.n, 0, arg3);
    }

    public void d() {
        this.a = null;
    }

    public boolean e() {
        boolean v0 = this.a != null ? true : false;
        return v0;
    }

    public String f() {
        return this.b;
    }

    public void g() {
        this.b = null;
    }

    public boolean h() {
        boolean v0 = this.b != null ? true : false;
        return v0;
    }

    public String i() {
        return this.c;
    }

    public void j() {
        this.c = null;
    }

    public boolean k() {
        boolean v0 = this.c != null ? true : false;
        return v0;
    }

    public long l() {
        return this.d;
    }

    public void m() {
        this.n = cd.b(this.n, 0);
    }

    public boolean n() {
        return cd.a(this.n, 0);
    }

    public void o() throws cm {
        if (this.a == null) {
            throw new dg("Required field \'domain\' was not present! Struct: " + this.toString());
        }

        if (this.c == null) {
            throw new dg("Required field \'new_id\' was not present! Struct: " + this.toString());
        }
    }

    public cg p() {
        return this.a();
    }

    static dk q() {
        return bk.g;
    }

    static da r() {
        return bk.h;
    }

    static da s() {
        return bk.i;
    }

    static da t() {
        return bk.j;
    }

    public String toString() {
        StringBuilder v0 = new StringBuilder("IdJournal(");
        v0.append("domain:");
        if (this.a == null) {
            v0.append("null");
        } else {
            v0.append(this.a);
        }

        if (this.h()) {
            v0.append(", ");
            v0.append("old_id:");
            if (this.b == null) {
                v0.append("null");
            } else {
                v0.append(this.b);
            }
        }

        v0.append(", ");
        v0.append("new_id:");
        if (this.c == null) {
            v0.append("null");
        } else {
            v0.append(this.c);
        }

        v0.append(", ");
        v0.append("ts:");
        v0.append(this.d);
        v0.append(")");
        return v0.toString();
    }

    static da u() {
        return bk.k;
    }
}

